package com.bojiu.lawsearch.lawsearch.service;

import com.bojiu.lawsearch.lawsearch.model.Engineer;
import com.bojiu.lawsearch.lawsearch.model.WechatUser;
import com.bojiu.lawsearch.lawsearch.util.JsonResult;
import springfox.documentation.spring.web.json.Json;

/**
 * @author: afdiao
 * @Date：2020/3/1 21:25
 * @Description:
 */
public interface WechatUserService {
    /**
     * 更具uinonid判断用户是否存在   存在返回用户明细，不存在返回用户id
     * @param unionid
     * @return
     */
    WechatUser exitUser(String unionid);


    JsonResult register(WechatUser wechatUser);
    JsonResult gzRegister(WechatUser wechatUser);

    JsonResult loginByPhone(String phone, String password);

    /**
     * 刷新token
     * @param userId  用户id
     * @return  返回时间戳
     */
    String refreshLoginTime(int userId) throws Exception;

    /**
     * 校验token
     * @param account
     * @param token
     * @return
     */
    boolean checkToken(String account, String token);

    WechatUser getByUserId(int userId,String sign);

    /**
     * 更新密码
     * @param newPassword
     * @param oldPassword
     * @param userId
     * @return
     */
    JsonResult updatePassword(String newPassword,String oldPassword, int userId);

    /**
     * 更新用户基本信息
     * @param headImg
     * @param nickName
     * @param sex
     * @param province
     * @param city
     * @param userId
     */
    void updateBaseInfo(String headImg, String nickName, int sex, String province, String city,int userId);

    /**
     * 注册工程师
     * @param userId
     * @param engineer
     * @return
     */
    JsonResult registerEngineer(int userId, Engineer engineer);

    /**
     * 我的收藏
     */
    JsonResult myCollect(int userId,String text);
}
